#include <iostream>
using namespace std;
#include <string>
#include <list>


void process(const string& str ,int index , list<string>& ans , string path1)
{
  if (str.length() == index)
  {
    ans.push_back(path1);
    return;
  }

  process(str , index + 1 , ans , path1);
  process(str , index + 1 , ans , path1 + str[index]);
}





int main()
{
  string str = "abc";
  list<string> ans;

  process(str , 0 , ans , "");
  cout << ans.size() << endl;
  for (auto x : ans)
  {
    cout << x << " ";
  }
  cout << endl;
  return 0;
}
